const {mysql} = require('../../qcloud')

module.exports = async (ctx) => {
  // const mysqlSelect = await mysql('jokes')
  //                 .select('jokes.*')
  //                 .join('ad', 'jokes.id', 'ad.id')
  //                 .orderBy('ad.id')
  // // ctx.state.data = JSON.parse(mysqlSelect)
  // console.log('mysqlSelect', mysqlSelect)
  const mysqlSelect = await mysql('jokes').select('text').from('jokes')
  ctx.state.data = mysqlSelect
}